require(["config"], function() {
    require(["jquery", "template", "load"], function($,template) {
        function List(){
            this.loadHotProducts();
        }
        $.extend(List.prototype,{
            //加载渲染列表商品
            loadHotProducts(){
                $.getJSON("http://rap2api.taobao.org/app/mock/120970/api/hot",(data)=>{
                    console.log(data)
                   const html = template("prod-template",{products:data.res_body.list})
                   console.log(html)
                   $("ul.grid_2").prepend(html);
                })
            }
        });
        new List();
    });
});
